import requests

from common.get_header import get_header


class IhrmModifyDep(object):
    def modify_dep(self, dep_id,req_header,req_data):
        resp = requests.put(url=f"http://ihrm2-test.itheima.net/api/company/department/{dep_id}",
                            headers=req_header,json=req_data)
        return resp

if __name__ == '__main__':
    ihrm = IhrmModifyDep()

    req_header = get_header()
    req_data = {"name": "测试部", "code": "1234"}
    ret = ihrm.modify_dep(1570785846452416512,req_header,req_data)
    print(ret.json())